<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "rbac_role_resource".
 *
 * @property int $resource_id 资源ID
 * @property int $role_id 角色ID
 */
class RbacRoleResource extends \common\models\BaseCommonModel
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'rbac_role_resource';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['resource_id', 'role_id'], 'integer'],
            [['role_id', 'resource_id'], 'unique', 'targetAttribute' => ['role_id', 'resource_id']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'resource_id' => 'Resource ID',
            'role_id' => 'Role ID',
        ];
    }
}
